package com.orange.quickback.system.controller.code.generator;

import com.orange.quickback.system.api.common.result.QBootResult;
import com.orange.quickback.system.entities.code.generator.QBootColumnSet;
import com.orange.quickback.system.service.code.generator.QBootCodeGeneratorService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@Api(tags = "代码生成器")
@RestController
@RequestMapping("/admin/")
public class QBootCodeGeneratorController {

    @Resource
    QBootCodeGeneratorService qBootCodeGeneratorService;
    @PostMapping("/getTableTemplate")
    public QBootResult getTableTemplate(@RequestBody QBootColumnSet qBootColumnSet){
        return qBootCodeGeneratorService.getTableTemplate(qBootColumnSet);
    }
    @PostMapping("/getAllColumnSet")
    public QBootResult getAllColumnSet(@RequestParam int page,@RequestParam int size) {
       return qBootCodeGeneratorService.getAllColumnSet(page,size);
    }
    @PostMapping("/getEntityTemplate")
    public QBootResult getEntityTemplate(@RequestBody QBootColumnSet qBootColumnSet) {
        return qBootCodeGeneratorService.getEntityTemplate(qBootColumnSet);
    }
    @PostMapping("/saveTableTemplate")
    public QBootResult saveTableTemplate(@RequestBody QBootColumnSet qBootColumnSet){
        return qBootCodeGeneratorService.saveTableTemplate(qBootColumnSet);
    }
    @PostMapping("/getDAOTemplate")
    public QBootResult getDAOTemplate(@RequestBody QBootColumnSet qBootColumnSet){
        return qBootCodeGeneratorService.getDAOTemplate(qBootColumnSet);
    }
    @PostMapping("/getTableApiTemplate")
    public QBootResult getTableApiTemplate(@RequestBody QBootColumnSet qBootColumnSet){
        return qBootCodeGeneratorService.getTableApiTemplate(qBootColumnSet);
    }
    @PostMapping("/getApiControllerTemplate")
    public QBootResult getApiControllerTemplate(@RequestBody QBootColumnSet qBootColumnSet){
        return qBootCodeGeneratorService.getApiControllerTemplate(qBootColumnSet);
    }
    @PostMapping("/getApiServiceTemplate")
    public QBootResult getApiServiceTemplate(@RequestBody QBootColumnSet qBootColumnSet){
        return qBootCodeGeneratorService.getApiServiceTemplate(qBootColumnSet);
    }
}
